import axios from '@/request/http'
import { commonOutDTO } from '@/api/common.d'
import {
  AjmlsQueryParam,
  AjmlsQueryResult,
  WjListQueryParam,
  WjListQueryResult,
  WjsxUpdateInputDTO,
  WjsxUpdateOutputDTO,
  WjwzUpdateInputDTO,
  WjwzUpdateOutputDTO,
  AjwjDeleteInputDTO,
  AjwjDeleteOutputDTO,
  AjxxAddInputDTO,
  AjxxAddOutputDTO,
  AjxxDeleteInputDTO,
  AjxxDeleteOutputDTO,
  AjmlSaveInputDTO,
  AjmlSaveOutputDTO,
  AjmlDeleteInputDTO,
  AjmlDeleteOutputDTO,
  AjmlImportInputDTO,
  AjmlImportOutputDTO,
  AjmlExportInputDTO,
  AjmlExportOutputDTO,
  WjnrUpdateInputDTO,
  WjnrUpdateOutputDTO,
  AjwjUploadInputDTO,
  AjwjUploadOutputDTO,
  AjwjmlCreateInputDTO,
  AjwjmlCreateOutputDTO,
  AjbmjgSaveInputDTO,
  AjbmjgSaveOutputDTO,
  MlmbDownloadOutputDTO,
  ZzmlCreateOutputDTO,
  ZzmlSaveInputDTO,
  ZzmlSaveOutputDTO,
  PlxgjlAddInputDTO,
  PlxgjlAddOutputDTO,
  YsczzmlbhListQueryParam,
  YsczzmlbhListQueryResult,
  UpdateMlgsQueryParam,
  UpdateMlgsQueryResult,
  AjxxGetInputDTO,
  AjxxGetOutputDTO,
  AjxxSaveInputDTO,
  AjxxSaveOutputDTO,
  AjryxxQueryInputDTO,
  AjryxxGetOutputDTO,
  MlxxQueryInputDTO,
  MlxxGetOutputDTO,
  PlxgjlGetOutputDTO,
  DzjzmlQueryParam,
  AjmlsbybmsahQueryParam,
} from './wsjzgl-dto'

export default class wsjzglService {
  /**
   * 获取案卷目录树
   */
  static queryAjmls(data: AjmlsQueryParam): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/queryAjmls', data)
  }

  /**
   * 获取所有部门受案号的案件及案卷目录树
   */
  static queryAllAjmlsbybmsah(data: AjmlsbybmsahQueryParam): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/queryAllAjmlsbybmsah', data)
  }

  // 获取电子卷宗目录树
  static queryDzjzml(data: DzjzmlQueryParam): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/queryDzjzml', data)
  }

  /**
   * 获取文件详细信息列表
   */
  static queryWjList(data: WjListQueryParam): Promise<commonOutDTO<WjListQueryResult[]>> {
    return axios.post('/api/wsjzgl/queryWjList', data)
  }
  /**
   * 修改文件顺序
   */
  static updateWjsx(
    data: WjsxUpdateInputDTO,
    ajbh?: string,
  ): Promise<commonOutDTO<WjsxUpdateOutputDTO>> {
    return axios.post('/api/wsjzgl/updateWjsx', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 文件位置调整
   */
  static updateWjwz(
    data: WjwzUpdateInputDTO,
    ajbh?: string,
  ): Promise<commonOutDTO<WjwzUpdateOutputDTO>> {
    return axios.post('/api/wsjzgl/updateWjwz', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 删除案卷文件
   */
  static deleteAjwj(
    data: AjwjDeleteInputDTO,
    ajbh?: string,
  ): Promise<commonOutDTO<AjwjDeleteOutputDTO>> {
    return axios.post('/api/wsjzgl/deleteAjwj', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 新增案卷信息
   */
  static addAjxx(data: AjxxAddInputDTO, ajbh?: string): Promise<commonOutDTO<AjxxAddOutputDTO>> {
    return axios.post('/api/wsjzgl/addAjxx', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 删除案卷信息
   */
  static deleteAjxx(
    data: AjxxDeleteInputDTO,
    ajbh?: string,
  ): Promise<commonOutDTO<AjxxDeleteOutputDTO>> {
    return axios.post('/api/wsjzgl/deleteAjxx', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 保存案卷目录
   */
  static saveAjml(data: AjmlSaveInputDTO, ajbh?: string): Promise<commonOutDTO<AjmlSaveOutputDTO>> {
    return axios.post('/api/wsjzgl/saveAjml', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 删除案卷目录
   */
  static deleteAjml(
    data: AjmlDeleteInputDTO,
    ajbh?: string,
  ): Promise<commonOutDTO<AjmlDeleteOutputDTO>> {
    return axios.post('/api/wsjzgl/deleteAjml', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 删除挂接电子卷宗目录附件
   */
  static deleteWsfj(data: any, ajbh?: string): Promise<commonOutDTO<AjmlDeleteOutputDTO>> {
    return axios.post('/api/wsjzgl/delWsfj', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 导入目录
   */ //AjmlImportInputDTO
  static importAjml(data: any, ajbh?: string): Promise<commonOutDTO<AjmlImportOutputDTO>> {
    return axios.post('/api/wsjzgl/importMl', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 导出目录
   */
  static exportAjml(data: AjmlExportInputDTO): Promise<commonOutDTO<Blob>> {
    return axios.post('/api/wsjzgl/exportMlExcel', data, { responseType: 'blob' })
  }
  /**
   * 更新文件内容
   */
  static updateWjnr(
    data: WjnrUpdateInputDTO,
    ajbh?: string,
  ): Promise<commonOutDTO<WjnrUpdateOutputDTO>> {
    return axios.post('/api/wsjzgl/updateWjnr', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 上传案卷文件
   */
  // AjwjUploadInputDTO
  static uploadAjwj(data: any, ajbh?: string): Promise<commonOutDTO<AjwjUploadOutputDTO>> {
    return axios.post('/api/wsjzgl/uploadAjwj', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 创建案卷文件目录（编目）
   */
  static createAjwjml(
    data: AjwjmlCreateInputDTO,
    ajbh?: string,
  ): Promise<commonOutDTO<AjwjmlCreateOutputDTO>> {
    return axios.post('/api/wsjzgl/createAjwjml', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 保存案卷编目结果
   */
  static saveAjbmjg(
    data: AjbmjgSaveInputDTO,
    ajbh?: string,
  ): Promise<commonOutDTO<AjbmjgSaveOutputDTO[]>> {
    return axios.post('/api/wsjzgl/saveAjbmjg', data, {
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 下载导入目录模版
   */
  static downMldrmb(data: any): Promise<commonOutDTO<MlmbDownloadOutputDTO>> {
    return axios.get('/api/wsjzgl/downMldrmb', data)
  }

  /**
   * 生成纸质目录
   */ //ZzmlSaveInputDTO
  static createZzml(data: any, ajbh?: string): Promise<commonOutDTO<Blob>> {
    return axios.post('/api/wsjzgl/createZzml', data, {
      responseType: 'blob',
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 保存纸质目录
   */
  static saveZzml(data: any, ajbh?: string): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/saveZzml', data, {
      responseType: 'blob',
      headers: {
        ajbh,
      },
    })
  }
  /**
   * 新增批量修改记录
   */
  static addPlxgjl(data: PlxgjlAddInputDTO): Promise<commonOutDTO<PlxgjlAddOutputDTO>> {
    return axios.post('/api/wsjzgl/addPlxgjl', data)
  }
  /**
   * 获取已生成纸质目录编号集合
   */
  static queryYsczzmlbhList(
    data: YsczzmlbhListQueryParam,
  ): Promise<commonOutDTO<YsczzmlbhListQueryResult>> {
    return axios.post('/api/wsjzgl/queryYsczzmlbhList', data)
  }
  /**
   * 调整目录归属
   */
  // UpdateMlgsQueryParam
  static updateMlgs(data: any, ajbh?: string): Promise<commonOutDTO<UpdateMlgsQueryResult>> {
    return axios.post('/api/wsjzgl/updateMlgs', data, {
      headers: {
        ajbh,
      },
    })
  }

  /**
   * 获取案卷详细信息
   */
  static getAjxx(data: AjxxGetInputDTO): Promise<commonOutDTO<AjxxGetOutputDTO>> {
    return axios.post('/api/wsjzgl/getAjxxxx', data)
  }

  /**
   * 保存案卷详细信息
   */ //AjxxSaveInputDTO
  static saveAjxx(data: any, ajbh?: string): Promise<commonOutDTO<AjxxSaveOutputDTO>> {
    return axios.post('/api/wsjzgl/saveAjxxxx', data, {
      headers: {
        ajbh,
      },
    })
  }

  // 查询案件人员信息
  static getQueryAjryxx(data: AjryxxQueryInputDTO): Promise<commonOutDTO<AjryxxGetOutputDTO[]>> {
    return axios.post('/api/wsjzgl/queryAjryxx', data)
  }

  // 获取目录信息
  static getQueryMlxx(data: MlxxQueryInputDTO): Promise<commonOutDTO<MlxxGetOutputDTO>> {
    return axios.post('/api/wsjzgl/getMlxx', data)
  }

  // 保存目录信息
  static updateRycljg(data: any): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/updateRycljg', data)
  }

  // 获取批量修改记录
  static getPlxgjl(data: MlxxQueryInputDTO): Promise<commonOutDTO<PlxgjlGetOutputDTO>> {
    return axios.post('/api/wsjzgl/getPlxgjl', data)
  }

  // 保存批量修改记录
  static savePlxgjl(data: any, ajbh?: string): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/savePlxgjl', data, {
      headers: {
        ajbh,
      },
    })
  }

  // 图片纠偏
  static pictureJp(data: any, ajbh?: string): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/wjjpToBase64', data, {
      headers: {
        ajbh,
      },
    })
  }

  // 图片色彩加强
  static pictureSczq(data: any, ajbh?: string): Promise<commonOutDTO<any>> {
    return axios.post('/api/gdgl/imgSczqToBase64', data, {
      headers: {
        ajbh,
      },
    })
  }

  // 图片黑白增强
  static pictureHbzq(data: any, ajbh?: string): Promise<commonOutDTO<any>> {
    return axios.post('/api/gdgl/imgHbzqToBase64', data, {
      headers: {
        ajbh,
      },
      timeout: 0,
    })
  }

  // 去黑边
  static pictureQhb(data: any, ajbh?: string): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/wjqhbToBase64', data, {
      headers: {
        ajbh,
      },
    })
  }

  // 图片纠偏
  static pictureJpG(data: any, ajbh?: string): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/wjjp', data, {
      headers: {
        ajbh,
      },
    })
  }

  // 去黑边
  static pictureQhbG(data: any, ajbh?: string): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/wjqhb', data, {
      headers: {
        ajbh,
      },
    })
  }
  // 电子卷宗下载
  static downTyywwj(data: any): Promise<commonOutDTO<any>> {
    return axios.get(
      `/api/wsjzgl/downTyywwj?dwbm=${data.dwbm}&wjhz=${data.wjhz}&wjxh=${data.wjxh}`,
      { responseType: 'blob' },
    )
  }
  //获取纸质案卷目录
  static getZzml(data: any): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/getZzml', data, { responseType: 'blob' })
  }

  //获取电子卷宗目录信息(挂接电子卷宗)
  static queryDzjzMlxx(data: any): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/queryDzjzMlxx', data)
  }

  //保存电子卷宗目录信息(挂接电子卷宗)
  static saveDzjzmlxx(data: any): Promise<commonOutDTO<any>> {
    return axios.post('/api/wsjzgl/saveDzjzmlxx', data)
  }
}
